﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UtilZ.Dotnet.Ex.Communication.Local.LRPC;
using UtilZ.Dotnet.Ex.Log;

namespace UtilZ.Tool.HostPluginBase
{
    public class LRPCHelper
    {

        public const string GET_WATCH_DOG_HTTP_PORT = "GET_WATCH_DOG_HTTP_PORT";

        /// <summary>
        /// 获取看门狗Http端口号
        /// </summary>
        /// <returns></returns>
        public static int GetWatchDogHttpPort()
        {
            object obj = LRPCCore.RemoteCallF(GET_WATCH_DOG_HTTP_PORT, null);
            return (int)obj;
        }


        public const string PUBLISH_LOG = "PUBLISH_LOG";
        /// <summary>
        /// 推送日志
        /// </summary>
        /// <param name="logItem">日志项</param>
        public static void PublishLog(LogItem logItem)
        {
            LRPCCore.TryRemoteCallA(PUBLISH_LOG, logItem);
        }
    }
}
